import requests
from config import url, headers_web


class UpdateCardNoLog:

    def __init__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def get_untreated_cardlog(cls, url: str, params=None, headers=headers_web):
        """
        @Summary:接口-获取门禁未处理的修改用户卡号日志
        @Description:调用方：1、teachingService
        :param url:
        :param params:
        :param headers:
        """
        url = url + "/authoritycontrolplatformapi/api/v1/updatecardnologs/entranceguardnothandledlogs"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def post_cardlog_status(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:接口-接口-更新卡号修改日志门禁处理状态为已处理
        @Description:调用方：1、teachingService
        :param url:
        :param params:
        :param headers:
        """
        url = url + "/authoritycontrolplatformapi/api/v1/updatecardnologs/entranceguardstatuses"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r
